package com.jblv.frame.demo.kafka;

import com.jblv.frame.common.kafka.MessageHandler;
import com.jblv.frame.common.kafka.bean.MqBaseMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author happyonion.yangtao
 * @version 1.0
 * @title SmsNotifyHandler
 * @projectName jblv-frame
 * @packageName com.jblv.user.service.kafka
 * @description
 * @date Create at 2020/4/17 14:09
 * @since jdk1.8
 */
public class SmsNotifyHandler implements MessageHandler {

    private static final Logger logger = LoggerFactory.getLogger(SmsNotifyHandler.class);


    @Override
    public void handler(Object object) {
        MqBaseMessage bean = (MqBaseMessage) object;

        if (bean == null) {
            return;
        }

        Object obj = bean.getObj();

        if (obj == null) {
            return;
        }

        if (obj instanceof String) {
            try {
                System.out.println("接收到:"+(String) obj);
                Thread.sleep(8000);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}